package com.lry.sso.auth.server.controller;

import com.lry.sso.auth.common.dto.AuthConfigInfo;
import com.lry.sso.auth.server.config.AuthConfigProperties;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 李瑞益
 * @date 2020-02-12 21:13
 */
@RestController
@RequestMapping("/sso/auth/v1/config")
public class AuthConfigController {

    @Autowired
    private AuthConfigProperties config;

    @GetMapping("")
    public AuthConfigInfo getConfig(){
        AuthConfigInfo result = new AuthConfigInfo();
        BeanUtils.copyProperties(config,result);
        return result;
    }
}
